package com.atcc.test.mapper;

import java.util.List;

import org.apache.ibatis.annotations.*;

import com.atcc.test.pojo.User;

@Mapper
public interface UserMapper {
	
	@Select("select * from user")
	@Results({
		@Result(column="name",property="name"),
		@Result(column="id",property="id"),
		@Result(column="department",property="department"),
		@Result(column="source",property="source")
	})
	List<User> getAll();
	
	@Select("select * from user where id = #{id}")
	@Results({
		@Result(column="name",property="name"),
		@Result(column="id",property="id"),
		@Result(column="department",property="department"),
		@Result(column="source",property="source")
	})
	User getUserById(Long id);

}
